package com.godaiyu.lagou.service;

import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import java.io.IOException;


public class DubboPureMain {
    public static void main(String[] args) throws IOException, InterruptedException {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ConsumerConfiguration.class);
        context.start();
        ParallelRpcMethodTransfer service = context.getBean(ParallelRpcMethodTransfer.class);

        System.in.read();
        service.parallelRun("world", 100);

        System.in.read();
    }

    @Configuration
    @PropertySource("classpath:/dubbo-consumer.properties")
    @ComponentScan("com.godaiyu.lagou.service")
    @EnableDubbo
    static class ConsumerConfiguration {

    }
}
